<title>消息中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(path)/assets/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script> 
#@checkToken()
<style> 
	body{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}
	*{margin:0;padding:0;}
	li{list-style-type:none;}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	}
</style>

<body bgcolor="#f4f5f9" style="margin:0px;">
<div id="alllist" align="center" style="padding-bottom:20px;"></div>
<div id="showlists"></div>	
<script id="demo" type="text/x-jquery-tmpl">
	<div align="center" pass="${id}" class="pass" style="width:100%;margin-top:10px;clear:both">
		<div style="width:90%;">
			<div align="left" style="">
				<img style="width:15px;margin-top:10px;float:left" src="#(assets)/images/mobile/message_1.png">
				<a style="color:${fontcolor};font-size:13px;line-height:35px;margin-left:5px;">${create_time}</a>
			</div>
		</div>
		<div align="left" style="width:90%;">
			<div  style="height:${heig};float:left;background:#ebebeb;width:2px;margin:0 7px 0 7px;"></div>
			<div class="news_list" style="width:87%;float:left;background:#fff;min-height:100px;max-height:160px;margin:0 7px 0 7px;">
				<div align="left" style="width:90%;padding:5px 5% 5px 5%;">
					<div><a style="color:${fontcolor};font-size:14px;">${name}</a></div>
					<div ${hid} ><img style="width:100%;height:100px;margin-top:5px;" src="${pic}"></div>
					<div style="display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:5px;">
						<a style="color:${fontcolor};font-size:13px;">${summary}</a>
					</div>
				</div>
			
			</div>
		</div>
	</div>
</script>

<script type="text/javascript" src="/assets/dropload/dropload.min.js"></script>
<link rel="stylesheet" href="/assets/dropload/dropload.css">
<script>
var page = 0;
$('#alllist').dropload({
	scrollArea : window,
	loadDownFn : function(me){
		page++; 
		var url = "/notice/list?token=#(session.token??)&size=10&type=activity&page="+page;
		console.log(page);
		$.getJSON(url, function(datalist) {
			$.each(datalist.data.page.list, function(i, item){ 
				console.log(item);
				if(item.pic==""){
					var hid = "hidden";
					var heig = "100px";
				}
				else{
					var heig = "160px";
				}
				if(item.is_read==1){
					var fontcolor = "#aaa"
				}else{
					var fontcolor = "#383838"
				}
				var invests = {fontcolor:fontcolor,id:item.id,heig:heig,name:item.name,summary:item.summary,create_time:item.create_time,pic:item.pic,hid:hid};
				$("#demo").tmpl(invests).appendTo('#alllist');
			});
			$(".pass").click(function(){
				var idval = $(this).attr("pass");
				window.location.href="#(path)/app/page/personal-noticeinfo?id="+idval;
				$.getJSON("#(path)/notice/setRead?token=#(session.token??)&id="+idval, function(datalist) {
				});
			});
			$(".dropload-down").css("height","0px"); 
			if(!datalist.data.page.lastPage){
				me.resetload();	
			}
		});
	}
});			
</script> 

</body>